package cn.damai.search.baseService.ipml;

import cn.damai.search.baseService.BaseKeywordSortService;
import cn.damai.search.mapper.KeywordSortMapper;
import cn.damai.model.KeywordSort;
import cn.damai.util.DubboUtil;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Component
@Service(version = DubboUtil.VRESION,group = DubboUtil.GROUP)
public class BaseKeywordSortServiceIpml implements BaseKeywordSortService {

    @Autowired
    private KeywordSortMapper keywordSortMapper;

    @Override
    public KeywordSort getKeywordSortById(@RequestParam Long id){
        return keywordSortMapper.getKeywordSortById(id);
    }

    @Override
    public List<KeywordSort>	getKeywordSortListByMap(@RequestParam Map<String,Object> param){
        return keywordSortMapper.getKeywordSortListByMap(param);
    }

    @Override
    public Integer getKeywordSortCountByMap(@RequestParam Map<String,Object> param){
        return keywordSortMapper.getKeywordSortCountByMap(param);
    }

    @Override
    public Integer qdtxAddKeywordSort(@RequestParam KeywordSort KeywordSort){
        KeywordSort.setCreatedTime(new Date());
        return keywordSortMapper.insertKeywordSort(KeywordSort);
    }

    @Override
    public Integer qdtxModifyKeywordSort(@RequestParam KeywordSort KeywordSort){
        KeywordSort.setUpdatedTime(new Date());
        return keywordSortMapper.updateKeywordSort(KeywordSort);
    }
}
